dojo.require("dojo.event.*");
dojo.require("dojo.io.*");
dojo.require("dojo.json");

function dojo_channel(call)
// summary:
//   Invoke remote procedure via Dojo Toolkit, using url, handle, and request passed via call parameter.
{
	var oBindArgs = {
		url: call.url+'?rpc',
		error: function(type, data, evt) { ANVIL.channelError(evt.responseText) },
		method: "POST",
		mimetype: "text/json",
		handle: function(type, data) { call.callback(data) },                    
		postContent: dojo.json.serialize(call.request)
	};
	var oRequest = dojo.io.bind(oBindArgs);
	dojo.event
	return oRequest;
}
